<script language="javascript">
<!--
function f_setGrid() {
	//trselObj.selectMode = "1";
}

function f_setfloat() {
	if (!trselObj.f_isSelectRow()) return ;
	var floatVal = window.prompt("<eam:message key="text.float.inputtitle" />" ,"");

	//alert(floatVal);
	if (floatVal == null || floatVal == "") return ;

	if (!f_isNumber(floatVal ,"number")) {
		alert("<eam:message key="common.tip.inputnum" />");
		return ;
	}

	var action = document.forms(formName).action.split("?")[0];
	var frmObj = document.forms(formName);

	action += "?floatVal=" + floatVal;
	action += "&materialTypeID=" + trselObj.getCurKeyid();

	frmObj.action = action;
	frmObj.ActionType.value = "setfloat";
	frmObj.target = targetName;
	frmObj.submit();
	document.all("setfloat").disabled = true;
}

function f_isNumber(aVal, aNumberType){
	if("" == aVal || null == aVal || "0" == aVal) return true;
	var regRule;
	switch(aNumberType){
		case "int": 
			regRule = /(^\-{0,1}|^[1-9]{1})[1-9]+$/;
			break;
		case "number":
			regRule = /(^0\.{1}|^[1-9]{1}|^\-{0,1}[0-9]{0,}[\.]{0,1})[0-9]{0,}$/;
			break;
		case "money":
			regRule = /(^0\.{1}|^[1-9]{1}|^\-{0,1}[0-9]{0,}[\.]{0,1})[0-9]{0,}$/;
			break;
	}
	return f_regTest(aVal, regRule);
}

function f_regTest(aValue, aRegRule){
	if("" == aValue) return true;
	var regObj = new RegExp(aRegRule);
	return regObj.test(aValue);
}

function f_doError() {
	document.all("setfloat").disabled = false;
	alert("Error!");
}

function f_doSuccess() {
	document.all("setfloat").disabled = false;
	alert("<eam:message key="forware.check.success" />");
}
//-->
</script>